from com.linkstec.dao.base.base_dao import BaseDao
from com.linkstec.models.user_history import UserHistory

class UserHistoryDao(BaseDao):
    def create_history(self, history: UserHistory) -> int:
        query = """INSERT INTO user_histories 
                   (user_id, action_type, old_value, new_value)
                   VALUES (%s, %s, %s, %s)"""
        return self.execute_update(query, (
            history.user_id,
            history.action_type,
            history.old_value,
            history.new_value
        ))